package com.aldobucchi.ds.op
{

	import com.aldobucchi.ds.container.zet.IOWSet;
	import com.aldobucchi.ds.container.zet.impl.owSet;
	import com.aldobucchi.utils.AbstractTest;
	import com.aldobucchi.utils.IOperator;


	public class SetMultiFilterOpTest extends AbstractTest
	{
		
		
		public function testMisc( ):void
		{

			
			var zet		:IOWSet = owSet( [1] );
			var result	:IOWSet = owSet( );
			var filters	:IOWSet = owSet( );
			
			var op:IOperator = new SetMultiFilterOp( zet, result, filters );			
			
				assertContainersEqual( result, [ 1 ] );
			
			
			
			zet.add( 3 );
				assertContainersEqual( result, [ 1, 3 ] );			
			
			
			
			zet.add( 8 );
			zet.add( 11 );
				assertContainersEqual( result, [ 1, 3, 8, 11 ] );
			
			
			
			filters.add( filterGT5 );
				assertContainersEqual( result, [ 8, 11 ] );			
					
			
			
			zet.add( 2 );
				assertContainersEqual( result, [ 8, 11 ] );		
				
				
			
			filters.add( filterST10 );
				assertContainersEqual( result, [ 8 ] );	
			
			
			zet.remove( 8 );
				assertContainersEqual( result, [ ] );			
					
					
			filters.remove( filterGT5 );
				assertContainersEqual( result, [ 1, 3, 2 ] );				
			
					
			filters.clear( );		
				assertContainersEqual( result, [ 1, 3, 2, 11 ] );	
					
		}
		
		
		
		
		private function filterGT5( e:* ):Boolean
		{
			return ( e > 5 );
		}
		
		
		
		private function filterST10( e:* ):Boolean
		{
			return ( e < 10 );
		} 
		
		
	}

}